package 多线程的同步互斥实验数组;

public class Main {
    public static void main(String[] args) {
        ProductConsume<Food> productConsume = new ProductConsume<Food>();
        Runnable p = new ProducterThread(productConsume);
        Runnable c = new ConsumeThread(productConsume);
        Thread product1 = new Thread(p);
        Thread product2 = new Thread(p);
        Thread consume1 = new Thread(c);
        Thread consume2 = new Thread(c);
        Thread consume3 = new Thread(c);
        product1.setName("生产者一号>");
        product2.setName("生产者二号>");
        consume1.setName("消费者一号>");
        consume2.setName("消费者二号>");
        consume3.setName("消费者三号>");

        product1.start();
        product2.start();
        consume1.start();
        consume2.start();
        consume3.start();

    }
}
